.class public Lcom/bitauto/autoeasy/picture/PictureParser;
.super Ljava/lang/Object;
.source "PictureParser.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/bitauto/autoeasy/picture/PictureParser$ImageList;
    }
.end annotation


# instance fields
.field private final FILEURL:Ljava/lang/String;

.field private final GROUP:Ljava/lang/String;

.field private TAG:Ljava/lang/String;

.field private final TITLE:Ljava/lang/String;

.field private imageLists:Ljava/util/ArrayList;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/ArrayList",
            "<",
            "Lcom/bitauto/autoeasy/picture/PictureParser$ImageList;",
            ">;"
        }
    .end annotation
.end field

.field private url:Ljava/lang/String;


# direct methods
.method public constructor <init>(Ljava/lang/String;)V
    .locals 1
    .parameter "url"

    .prologue
    .line 42
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 24
    const-string v0, "fileurl"

    iput-object v0, p0, Lcom/bitauto/autoeasy/picture/PictureParser;->FILEURL:Ljava/lang/String;

    .line 25
    const-string v0, "title"

    iput-object v0, p0, Lcom/bitauto/autoeasy/picture/PictureParser;->TITLE:Ljava/lang/String;

    .line 26
    const-string v0, "group"

    iput-object v0, p0, Lcom/bitauto/autoeasy/picture/PictureParser;->GROUP:Ljava/lang/String;

    .line 30
    const-string v0, ""

    iput-object v0, p0, Lcom/bitauto/autoeasy/picture/PictureParser;->url:Ljava/lang/String;

    .line 31
    const-string v0, "PictureParser"

    iput-object v0, p0, Lcom/bitauto/autoeasy/picture/PictureParser;->TAG:Ljava/lang/String;

    .line 43
    iput-object p1, p0, Lcom/bitauto/autoeasy/picture/PictureParser;->url:Ljava/lang/String;

    .line 44
    return-void
.end method


# virtual methods
.method public Paser2Object()V
    .locals 10

    .prologue
    const-string v9, "error :"

    .line 47
    new-instance v6, Ljava/util/ArrayList;

    invoke-direct {v6}, Ljava/util/ArrayList;-><init>()V

    iput-object v6, p0, Lcom/bitauto/autoeasy/picture/PictureParser;->imageLists:Ljava/util/ArrayList;

    .line 49
    :try_start_0
    iget-object v6, p0, Lcom/bitauto/autoeasy/picture/PictureParser;->url:Ljava/lang/String;

    invoke-static {v6}, Lcom/bitauto/autoeasy/tool/Caller;->doGet(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v5

    .line 50
    .local v5, str:Ljava/lang/String;
    new-instance v4, Lorg/json/JSONObject;

    invoke-direct {v4, v5}, Lorg/json/JSONObject;-><init>(Ljava/lang/String;)V

    .line 53
    .local v4, jObject:Lorg/json/JSONObject;
    const-string v6, "imagelist"

    invoke-virtual {v4, v6}, Lorg/json/JSONObject;->getJSONArray(Ljava/lang/String;)Lorg/json/JSONArray;

    move-result-object v3

    .line 54
    .local v3, jArray:Lorg/json/JSONArray;
    const/4 v1, 0x0

    .local v1, i:I
    :goto_0
    invoke-virtual {v3}, Lorg/json/JSONArray;->length()I

    move-result v6

    if-lt v1, v6, :cond_0

    .line 68
    .end local v1           #i:I
    .end local v3           #jArray:Lorg/json/JSONArray;
    .end local v4           #jObject:Lorg/json/JSONObject;
    .end local v5           #str:Ljava/lang/String;
    :goto_1
    return-void

    .line 55
    .restart local v1       #i:I
    .restart local v3       #jArray:Lorg/json/JSONArray;
    .restart local v4       #jObject:Lorg/json/JSONObject;
    .restart local v5       #str:Ljava/lang/String;
    :cond_0
    invoke-virtual {v3, v1}, Lorg/json/JSONArray;->getJSONObject(I)Lorg/json/JSONObject;

    move-result-object v6

    invoke-virtual {p0, v6}, Lcom/bitauto/autoeasy/picture/PictureParser;->createImageList(Lorg/json/JSONObject;)Lcom/bitauto/autoeasy/picture/PictureParser$ImageList;

    move-result-object v2

    .line 56
    .local v2, image:Lcom/bitauto/autoeasy/picture/PictureParser$ImageList;
    if-eqz v2, :cond_1

    .line 57
    iget-object v6, p0, Lcom/bitauto/autoeasy/picture/PictureParser;->imageLists:Ljava/util/ArrayList;

    invoke-virtual {v6, v2}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
    .catch Lcom/bitauto/autoeasy/tool/WSError; {:try_start_0 .. :try_end_0} :catch_1

    .line 54
    :cond_1
    add-int/lit8 v1, v1, 0x1

    goto :goto_0

    .line 60
    .end local v1           #i:I
    .end local v2           #image:Lcom/bitauto/autoeasy/picture/PictureParser$ImageList;
    .end local v3           #jArray:Lorg/json/JSONArray;
    .end local v4           #jObject:Lorg/json/JSONObject;
    .end local v5           #str:Ljava/lang/String;
    :catch_0
    move-exception v6

    move-object v0, v6

    .line 61
    .local v0, e:Ljava/lang/Exception;
    const/4 v6, 0x0

    iput-object v6, p0, Lcom/bitauto/autoeasy/picture/PictureParser;->imageLists:Ljava/util/ArrayList;

    .line 62
    iget-object v6, p0, Lcom/bitauto/autoeasy/picture/PictureParser;->TAG:Ljava/lang/String;

    new-instance v7, Ljava/lang/StringBuilder;

    const-string v8, "error :"

    invoke-direct {v7, v9}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v0}, Ljava/lang/Exception;->toString()Ljava/lang/String;

    move-result-object v8

    invoke-virtual {v7, v8}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v7

    invoke-virtual {v7}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v7

    invoke-static {v6, v7}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I

    .line 63
    invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V

    goto :goto_1

    .line 64
    .end local v0           #e:Ljava/lang/Exception;
    :catch_1
    move-exception v6

    move-object v0, v6

    .line 65
    .local v0, e:Lcom/bitauto/autoeasy/tool/WSError;
    iget-object v6, p0, Lcom/bitauto/autoeasy/picture/PictureParser;->TAG:Ljava/lang/String;

    new-instance v7, Ljava/lang/StringBuilder;

    const-string v8, "error :"

    invoke-direct {v7, v9}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v0}, Lcom/bitauto/autoeasy/tool/WSError;->toString()Ljava/lang/String;

    move-result-object v8

    invoke-virtual {v7, v8}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v7

    invoke-virtual {v7}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v7

    invoke-static {v6, v7}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I

    .line 66
    invoke-virtual {v0}, Lcom/bitauto/autoeasy/tool/WSError;->printStackTrace()V

    goto :goto_1
.end method

.method public createImageList(Lorg/json/JSONObject;)Lcom/bitauto/autoeasy/picture/PictureParser$ImageList;
    .locals 5
    .parameter "obj"

    .prologue
    .line 71
    new-instance v1, Lcom/bitauto/autoeasy/picture/PictureParser$ImageList;

    invoke-direct {v1, p0}, Lcom/bitauto/autoeasy/picture/PictureParser$ImageList;-><init>(Lcom/bitauto/autoeasy/picture/PictureParser;)V

    .line 73
    .local v1, imageList:Lcom/bitauto/autoeasy/picture/PictureParser$ImageList;
    :try_start_0
    const-string v2, "fileurl"

    invoke-virtual {p1, v2}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Lcom/bitauto/autoeasy/picture/PictureParser$ImageList;->setFileurl(Ljava/lang/String;)V

    .line 74
    const-string v2, "group"

    invoke-virtual {p1, v2}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Lcom/bitauto/autoeasy/picture/PictureParser$ImageList;->setGroup(Ljava/lang/String;)V

    .line 75
    const-string v2, "title"

    invoke-virtual {p1, v2}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Lcom/bitauto/autoeasy/picture/PictureParser$ImageList;->setTitle(Ljava/lang/String;)V
    :try_end_0
    .catch Lorg/json/JSONException; {:try_start_0 .. :try_end_0} :catch_0

    move-object v2, v1

    .line 80
    :goto_0
    return-object v2

    .line 77
    :catch_0
    move-exception v2

    move-object v0, v2

    .line 78
    .local v0, e:Lorg/json/JSONException;
    const-string v2, "BbsInfoParser"

    new-instance v3, Ljava/lang/StringBuilder;

    const-string v4, "error :"

    invoke-direct {v3, v4}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v0}, Lorg/json/JSONException;->toString()Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    invoke-static {v2, v3}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I

    .line 79
    invoke-virtual {v0}, Lorg/json/JSONException;->printStackTrace()V

    .line 80
    const/4 v2, 0x0

    goto :goto_0
.end method

.method public getImageLists()Ljava/util/ArrayList;
    .locals 1
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "()",
            "Ljava/util/ArrayList",
            "<",
            "Lcom/bitauto/autoeasy/picture/PictureParser$ImageList;",
            ">;"
        }
    .end annotation

    .prologue
    .line 35
    iget-object v0, p0, Lcom/bitauto/autoeasy/picture/PictureParser;->imageLists:Ljava/util/ArrayList;

    return-object v0
.end method

.method public setImageLists(Ljava/util/ArrayList;)V
    .locals 0
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/ArrayList",
            "<",
            "Lcom/bitauto/autoeasy/picture/PictureParser$ImageList;",
            ">;)V"
        }
    .end annotation

    .prologue
    .line 39
    .local p1, imageLists:Ljava/util/ArrayList;,"Ljava/util/ArrayList<Lcom/bitauto/autoeasy/picture/PictureParser$ImageList;>;"
    iput-object p1, p0, Lcom/bitauto/autoeasy/picture/PictureParser;->imageLists:Ljava/util/ArrayList;

    .line 40
    return-void
.end method
